Oh boy...now I'm more confused than ever. Some of your reply made perfect sense, some of it I'm really struggling with now.
I took a look at the Hall commutation c program. The first question I have is why one would even both specifying the encoder input channel, or even that we're using an encoder at all, if you're using some math to figure out where you are in the commutation cycle and then outputting it directly via the Write3PH function. Aren't we just using some GPIO bits to "roll your own" encoder? In other words, why not specify that there is not an encoder? Or, are you specifying an encoder because something down in the firmware need to know we are using an "encoder"... or is this more just so that the FIR filters (if desired) could be used from the "encoder" input?
But the larger issue is that I still don't get how PWMs are getting assigned to axes and the corresponding outputchan within each axis. Does specifying outputchan1 as 0 turn it off, or it disregarded if it's given a value of zero? It would help if you could construct a table or a diagram to explain how PWM/capture/compare registers (or their resultant signals) are being assigned to output channels, and how these are then interpreted by the Snap Amp. The mechanics of how all this works is still a mystery to me and I'm worried that I'll blow something to bits if I get it wrong.
Thanks!
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Erik,
> Â
> In that case, your 1.5K pull up should work. There is no direct support for this you will need a User program to do the commutation. See the example HallCommutate.c which should commutate the motor and spin it while applying an amplitude of "A" to the motor. You will need to figure out the commutation sequence experimentally and put the values in the table. If your 3phase brushless is connected to the "B" side of the SnapAmp then specify the OutputChan0 as 10.  You can also use the output of the table which is basically an angle to create the current position and save it into
> Â
> ch1->Position
> Â
> Set the Input Mode to "User Input". You will need to handle the wraparound. If you need help doing this let me know.
> Â
> With the output mode set to "No Output" you can do the output yourself with the User Program by writing the Amplitude from ch1->Output.
> Â
> Actually now that I think about it I don't see why it wouldn't work and commutate exactly like we were doing sinusoidal commutation right from an encoder. But in this case we just have a really coarse encoder (6 counts per cycle). So try setting invCountPerCycle=1/6.0 to see if that works..
> Â
> Â
> Regarding your Stepper motor connected to SnapAmp Side A set the OutputMode as "Microstepper" and set OutputChan0=8 and OutputChan1=9. For steppers the two coils us two independent full H bridges so the software allows independent settings. For 3Phase drive 3 of the 4 half bridges are used together and must be all on one "side" so one OutputChan0 setting is sufficient.
> Â
> Â
> For your 3rd Step/Dir Axis use OutputMode "Step Dir" And OutputChan0=4 to use the 4th Step/Dir Generator coming out on JP5 pins 1 and 2 driven as open collector mode.
> Â
> Â
> Hope this helps somewhat.
> Â
> Regards
> TKÂ
> Â
> Â
> Â
> Â
>
>
> ________________________________
> From: quelisto <quelisto@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, January 25, 2012 10:42 AM
> Subject: [DynoMotion] Re: Halls for bldc feedback
>
>
> Â
> Oh no doubt, Halls have terrible resolution. But, they are way cheaper than having to buy an encoder (they are essentially "free" as they come wth most BLDCs). If I'm only doing velocity control, I would think they'd be more than adequate for the job. I am primarily interested in making sure commutation phasing is correct.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Erik,
> > ÃÂ
> > Hall sensors are sometimes used for brushless commutation not position feedback.ÃÂ But the preferred method is to use the encoder position (with an index pulse) to do sinusoidal commutation.ÃÂ This involves fewer IO bits, less wiring, and smoother commutation with less torque ripple.ÃÂ
> > ÃÂ
> > There is a C program to analyze your brushless motor characteristics automatically.ÃÂ You only need to wire up the encoder and an index pulse and the 3 motor phases (to Out0, Out1, Out2 for side A of SnapAmp, or Out4, Out5, Out6 for side B).ÃÂ The program is called AutoPhaseFind.c.ÃÂ You will need to change some defines for your situation (which axis, which encoder, which index pulse input, which SnapAmp, etc...)ÃÂ Running the program will rotate the motor like a stepper motor by energizing the various phases while watching the encoder and the index pulse.ÃÂ From this it will determine the motor characteristics - encoder counts per cycle and the required commutation offset.ÃÂ This is the first step in getting a brushless motor to work.
> > ÃÂ
> > So it normally isn't necessary to wire the hall sensors unless you need to use them for some other reason.
> > ÃÂ
> > Regards
> > TK
> >
> > From: quelisto <quelisto@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Tuesday, January 24, 2012 9:14 PM
> > Subject: [DynoMotion] Halls for bldc feedback
> >
> >
> > ÃÂ
> > Tom: I presume it is possible to use Hall effect sensors for feedback. How can this be implemented in the software? The Halls on a motor I am using are TTL level signals, basically they are open collector with a pull-up resistor to 5V that I add on (for now they're 1.5 K).
> >
> > Thanks.
> >
>
|
|